
/************************************************************
 *
 * 1*2*3*...*1000 is definitely a very big integer. How many
 * consecutive 0s at the tail of the integer?
 *
 * Date: 5/28/2008
 ***********************************************************/

#include <stdio.h>

int main()
{
    int n2 = 0, n5 = 0, i, j;

    for( i = 1; i <= 1000; i++ ){

        j = i;
        while( j % 2 == 0 ){
            n2++;
            j = j / 2;
        }

        j = i;
        while( j % 5 == 0 ){
            n5++;
            j = j / 5;
        }

    }

    printf("%d\n", n2 < n5 ? n2 : n5);
	return 0;
}

